package com.ysd.lis.controller.lab;

import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.lab.LabSupplier;
import com.ysd.lis.request.lab.SupplierDto;
import com.ysd.lis.request.lab.SupplierPageParam;
import com.ysd.lis.service.lab.LabSupplierService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author prs
 * @since 2024-01-31
 */
@Api(tags = "供应商")
@RestController
@RequestMapping("/lis/lab/supplier")
public class LabSupplierController extends BaseController {

    @Autowired
    LabSupplierService labSupplierService;
    @ApiOperation("分页查询")
    @GetMapping("/findSupplierPageList")
    public Result findSupplierPageList(SupplierPageParam pageParam){
        return labSupplierService.findSupplierPageList(pageParam);
    }
    @ApiOperation("新增")
    @PostMapping("/addSupplier")
    public Result addSupplier(@RequestBody LabSupplier supplier){
        return  labSupplierService.addSupplier(supplier);
    }

    @ApiOperation("修改")
    @PostMapping("/editSupplier")
    public Result editSupplier(@RequestBody LabSupplier supplier) {
        return labSupplierService.editSupplier(supplier);
    }

    @ApiOperation("根据详情id删除详情数据")
    @PostMapping("/deleteSupplier")
    public Result deleteSupplier(@RequestBody LabSupplier supplier) {
        return labSupplierService.deleteSupplier(supplier);
    }
    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteSupplierList")
    public Result batchDeleteSupplierList(@RequestBody SupplierDto dto){
        return  labSupplierService.batchDeleteSupplierList(dto);
    }



}
